﻿
@{
    ViewBag.Title = "HiddenTroubleAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="SafetyResponsibilityController" ng-init="AddModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     Id='@(Request.QueryString["Id"].IsEmpty() ? "1" : Request.QueryString["Id"])';
     PlaceId='@(Request.QueryString["PlaceId"].IsEmpty() ? "1" : Request.QueryString["PlaceId"])';
     PlaceName='@(Request.QueryString["PlaceName"].IsEmpty() ? "" : Request.QueryString["PlaceName"])';
     AddModel.LevelId='0';
     AddModel.TypeId='0';
     GetRiskTypeList();
     GetRiskLevelList();
     GetPlaceRisk(Id);
     ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />

			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="page-heading">
        <h1>添加场所措施</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主体业务</a></li>
        <li><a>安全责任</a></li>
        <li><a>场所风险措施</a></li>
        <li class="active"><a>添加场所风险</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>添加场所风险</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">风险类型：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="RiskModel.TypeId">
                                        <option value="0">请选择风险类型</option>
                                        <option ng-repeat="x in RiskTypeList" value="{{x.Id}}">{{x.TypeName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">作业活动：</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" ng-model="RiskModel.JobActivity" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">风险等级：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="RiskModel.LevelId">
                                        <option value="0">请选择风险等级</option>
                                        <option ng-repeat="x in RiskLevelList" value="{{x.Id}}">{{x.LevelName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">风险评定等级：</label>
                                <div class="col-sm-8">
                                    <select class="form-control" ng-model="RiskModel.Rating" title="请选择风险等级">
                                        <option value="0">请选择风险评定等级</option>
                                        <option ng-repeat="x in RiskLevelList" value="{{x.Id}}">{{x.LevelName}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">风险内容：</label>
                                <div class="col-sm-8">
                                    <textarea ng-model="RiskModel.RiskContent" placeholder="风险内容" maxlength="2000" rows="6" class="form-control"></textarea>
                                </div>
                                <label class="control-label">{{RiskModel.RiskContent.length}}/2000</label>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">后果：</label>
                                <div class="col-sm-8">
                                    <textarea ng-model="RiskModel.Consequence" placeholder="后果" maxlength="200" rows="6" class="form-control"></textarea>
                                </div>
                                <label class="control-label">{{RiskModel.Consequence.length}}/200</label>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <textarea ng-model="RiskModel.Remark" ng-init="RiskModel.Remark=''" placeholder="备注" maxlength="500" rows="4" class="form-control"></textarea>
                                </div>
                                <label class="control-label">{{RiskModel.Remark.length}}/500</label>
                            </div>
                            <div class="panel-footer">
                                <div class="col-sm-2">

                                </div>
                                <div class="col-sm-2">
                                    <button ng-click="EditPlaceRisk(RiskModel,page,PlaceName)" class="btn btn-primary">保存</button>
                                </div>
                                <div class="col-sm-2">
                                    <a href="PlaceRiskList?page={{page}}&PlaceId={{PlaceId}}&PlaceName={{PlaceName}}" class="btn btn-danger">返回</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>

</div>


@section Js{
    <script src="~/Assets/js/pg/SafetyResponsibility.js"></script>
}
